package com.wenda.homeschooedu.biz;

import java.util.List;

import com.google.gson.Gson;
import com.wenda.homeschooedu.daoimpl.LessonService;
import com.wenda.homeschooedu.model.Lesson;

public class LessonManager {
	LessonService lessonService = null;

	public LessonManager() {
		lessonService = new LessonService();
	}

	public List<Lesson> getLessonListByClass(int class_id, int year, int term) {
		return lessonService.getLessonList(class_id, year, term);
	}

	public String getLessonListByClassToJson(int class_id, int year, int term) {
		Gson gson = new Gson();
		List<Lesson> lessons = getLessonListByClass(class_id, year, term);
		String result = gson.toJson(lessons);
		return result;

	}

}
